(function(){
	
	var ModuleNamePrefix = 'AppView.sys.role.';
	var ModuleUrlPrefix = '/sys/role';
	
	Ext.define(ModuleNamePrefix + 'SysRoleMenuPanel',{
		extend:'AppView.sys.menu.MeunTreeSel',
		alias:'widget.sysrolemenupanel',
		roleId:'',
        tbar:[
        	{
        		text:'保存',
	    		name:'save',
	    		icon:'resources/button/save.png',
	    		disabled:true,
	    		handler:function(){
	    			var nodeIds = this.up('panel').getAllSelectionNodeIds();
	    			var roleId = this.up('sysrolemenupanel').roleId;
	    			if(roleId == ''){
	    				Ext.Msg.alert('提示','请选择角色');
	    				return
	    			}
	    			Ext.Ajax.request({
					    url: ModuleUrlPrefix+"/saveSysRoleMenu.do",
					    method:'POST',
					    params: {
					        menuIds: nodeIds,
					        roleId:roleId
					    },
					    success: function(response){
					        var text = Ext.decode(response.responseText);
							Ext.Msg.alert('提示',text.message);
					    }
					});
	    		}
        	}
        ]
	})
})()